<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'list.jsp' starting page</title>

    <link href="/css/content.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        #down table {
            position: relative;
            left: 50%;
            margin-left: -500px;
            top: 50px;
            border-top: 1px #999 solid;
            border-right: 1px #999 solid;
        }

        #down tr {
            height: 60px;
        }

        #down tr td {
            text-align: center;
            border-left: 1px #999 solid;
            border-bottom: 1px #999 solid;
        }

        #up a:VISITED, #up a:LINK {
            color: #4C8FBD;
            text-decoration: none;
        }

        #up a:HOVER {
            color: #4C8FBD;
            text-decoration: none;
        }

        .head {
            background: #438EB9;
            color: #fff;
        }

        tbody tr:nth-child(odd) {
            background: #e5e5e5;
        }

        tbody tr:nth-child(even) {
            background: #d5d5d5;
        }
    </style>
    <script type="text/javascript" src="/js/jquery-3.7.1.js"></script>
    <script type="text/javascript">

    </script>
</head>

<body>
<div id="up">
    <ul>
        <li><span><a href="admin/welcome">平台首页 </a>&gt; 社团 &gt; 社团管理</span></li>
    </ul>
</div>
<div id="down">
    <%--		社团管理：查询所有社团信息，针对社团进行添加，修改，删除，查询。--%>
    <table width="1000px" cellpadding="0" cellspacing="0">
        <thead>
        <tr class="head">
            <td>序号</td>
            <td>社团编号</td>
            <td>社团名称</td>
            <td>社团级别</td>
            <td>社团风采</td>
            <td width="400px">社团招新</td>
            <td>联系我们</td>
            <td>编辑</td>
        </tr>
        </thead>


        <tbody>
        <c:forEach items="${ClubList}" var="club" varStatus="status">
            <tr>
                <td>${status.count}</td>
                <td>${club.clubID}</td>
                <td>${club.clubName}</td>
                <td>${club.level}</td>
                <td>${club.clubStyle}</td>
                <td>${club.clubRecruitment}</td>
                <td>${club.contactUs}</td>
                <td>
                    <a href="/club/getClubById?id=${club.clubID}">社团详情</a>|
                    <a href="/club/toEditClub?id=${club.clubID}">修改</a>|
                        <%--							<a href="/pages/clubResource.jsp?id=${club.clubID}">资源管理</a>--%>
                    <a href="/club/deleteClubById?id=${club.clubID}" class="del"
                       onclick="return confirm('这将删除俱乐部且清退所有该俱乐部成员\n是否确定删除？')">删除</a>&nbsp;
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="10">
                <a href="/club/getAllClub?currentPage=1">首页</a>
                <a href="/club/getAllClub?currentPage=${ClubPages.getPrePage()}">上一页</a>
                <c:forEach items="${ClubPages.getPageList()}" var="num">
                    <a href="/club/getAllClub?currentPage=${num}">[${num}]</a>
                </c:forEach>
                <a href="/club/getAllClub?currentPage=${ClubPages.getNextPage()}">下一页</a>
                <a href="/club/getAllClub?currentPage=${ClubPages.getTotalPage()}">尾页</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>
